<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');

            $table->char('uuid', 32)->unique(); //$table->uuid() = char(36) by default

            $table->string('xcx_openid'); //WX Xiaochengxu openid
            $table->string('mobile', 11);

            $table->string('nickname', 32);
            $table->text('intro');
            $table->string('motto', 32);
            $table->char('gender', 1)->default(0);
            $table->string('school', 32);
            $table->string('job', 32);
            $table->string('location', 32);

            $table->char('status', 1)->default('0');
            //0:ok; 1:verified by admin; f:forbidden, r:red

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
